package example.hellosecurity.srevers;

import example.hellosecurity.entity.User;
import example.hellosecurity.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServler {

    @Autowired
    private UserMapper userMapper;

    public User findUserName(String username){
        User byUsername = userMapper.findByUsername(username);
        return byUsername;
    }

    /*
    * 根据用户主键查询角色名称
    * */
    public List<String> selectRoleByUserId(User user){
    return userMapper.selectRoleByUserId(user.getId());

    }
    /*
    * 根据用户主键查询资源描述
    * */

    public List<String> selectByUserId(User user){
    return userMapper.selectByUserId(user.getId());
    }


}
